import $http from '../../../servers/http';
import { Result } from '../../schema/Result';
/* 运营数据统计-------------------------------- */
import { realtimeData, pieData, lineData } from '../../schema/DataStatistics';

/**查询今日实时数据*/
export const getRealtimeData = (): Promise<Result<realtimeData>> => {
  return $http.get({
    url: '/icms/statistics/realtimedata',
  });
};

/**查询企业行业分布据*/
export const getCorporationRateData = (): Promise<Result<pieData[]>> => {
  return $http.get({
    url: '/icms/statistics/industrydistribution',
  });
};

/**查询号码区域分布*/
export const getAreaData = (): Promise<Result<{ results: [] }>> => {
  return $http.get({
    url: '/icms/statistics/regionaldistribution',
  });
};

/**查询通话量 */
export const getCallnumber = (data: { timeInterval: string }): Promise<Result<lineData[]>> => {
  return $http.get({
    url: '/icms/statistics/callnumber',
    data,
  });
};

/**查询通话时长 */
export const getCallduration = (data: { timeInterval: string }): Promise<Result<lineData[]>> => {
  return $http.get({
    url: '/icms/statistics/callduration',
    data,
  });
};
